<?php
//add_bug.php
//Desc: Script reads user supplied values and inserts bug record.
//Author: Brian Murphy (Group 1)
//CS633, BU, Summer 2012, Term 1
//Declare and assign variable values
$PriToAdd = $_POST['newPri'];
$DescToAdd = $_POST['newDesc'];
$StatusToAdd = $_POST['newStatus'];
$DateAssignedToAdd = $_POST['newDateAssigned'];
$AssigneeToAdd = $_POST['newAssignee'];
$OwnerToAdd = $_POST['newOwner'];
$ProjectToAdd = $_POST['newProject'];

//Bugsby database connection
require_once('database2.php');

//Database insert statement and execution
$query = "INSERT INTO BugMaster
			(Priority, Description, Status, DateAssigned, Assignee, Owner, projectID)
			VALUES
			('$PriToAdd', '$DescToAdd', '$StatusToAdd', '$DateAssignedToAdd', '$AssigneeToAdd', '$OwnerToAdd', '$ProjectToAdd')";
$db->exec($query);

//Return to updated buglist
include('buglist.php');

?>